<template>
  <page-layout :avatar="currUser.avatar">
    <div slot="headerContent">
      <div class="title">你好啊，{{ currUser.name }}，今天又是充满活力的一天呢。</div>
      <div>高级评奖平台管理员</div>
    </div>
    <template slot="extra">
      <head-info class="split-right" :title="$t('project')" content="56"/>
      <head-info class="split-right" :title="$t('ranking')" content="8/24"/>
      <head-info class="split-right" :title="$t('visit')" content="2,223"/>
    </template>
    <template>
      <a-row style="margin: 0 -12px">
        <a-col style="padding: 0 12px" :xl="120">
          <a-card class="project-list" :loading="loading" :bordered="false"
                  :title="$t('progress')" :body-style="{padding: 0}">
            <a slot="extra">功能快速导航</a>
            <div>
              <a-card-grid :key="i" v-for="(item, i) in projects">
                <a-card hoverable
                        @click="TestCon(item.path)">
                  <a-card-meta :title="item.title" :description="item.desc">
                    <a-avatar slot="avatar" :src="item.logo"/>
                  </a-card-meta>
                </a-card>
              </a-card-grid>

            </div>
          </a-card>
        </a-col>
      </a-row>
    </template>
  </page-layout>
</template>

<script>
import PageLayout from '@/layouts/PageLayout'
import HeadInfo from '@/components/tool/HeadInfo'
//import Radar from '@/components/chart/Radar'
import {mapState} from 'vuex'
//import {request, METHOD} from '@/utils/request'

export default {
  name: 'WorkPlace',
  //Radar
  components: {HeadInfo, PageLayout},
  i18n: require('./i18n'),
  data() {
    return {
      projects: [],
      loading: true,
      activities: [],
      teams: [],
      welcome: {
        timeFix: '',
        message: ''
      }
    }
  },
  computed: {
    ...mapState('account', {currUser: 'user'}),
    ...mapState('setting', ['lang'])
  },
  created() {

    this.projects.push(
        {
          i: 0,
          title: "申报项目管理",
          desc: "前往申报项目管理界面，管理申报项目,",
          logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
          path: "/list/application-items"
        }, {
          i: 1,
          title: "专家列表",
          desc: "seafs",
          logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
          path: "/list/ExpertList"
        }, {
          i: 2,
          title: "奖项管理",
          desc: "seafs",
          logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
          path: "/list/prize"
        }, {
          i: 3,
          title: "评审组列表",
          desc: "seafs",
          logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
          path: "/list/panslesExpert"
        }, {
          i: 4,
          title: "项目分类",
          desc: "seafs",
          logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
          path: "/list/project-classify"
        }, {
          i: 5,
          title: "参选企业管理",
          desc: "seafs",
          logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
          path: "/list/add-enterprise"
        },
        // {
        //     i: 6,
        //     title: "占位",
        //     desc: "seafs",
        //     logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
        //     path: "/list/add-enterprise"
        // },
        // {
        //     i: 7,
        //     title: "占位",
        //     desc: "seafs",
        //     logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
        //     path: "/list/add-enterprise"
        // },{
        //     i: 8,
        //     title: "占位",
        //     desc: "seafs",
        //     logo: "https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png",
        //     path: "/list/add-enterprise"
        // },
    )

    this.loading = false
  },
  methods: {
    TestCon(path) {
      console.log(path)
      // this.$router.go(-1)
      this.$router.push({path: path});
    }
  }

}
</script>

<style lang="less">
@import "index";

</style>
